package com.haipumi.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.haipumi.beans.haipumi_exchangelist;
import com.haipumi.biz.IBackExchangeBiz;
import com.haipumi.dao.IBackExchangeDao;
import com.haipumi.mapper.ExchangeMapper;

@Service("backExchangeBiz")
public class BackExchangeBizImpl implements IBackExchangeBiz {

	@Autowired
	ExchangeMapper exchangeMapper;
	
	@Override
	public List<haipumi_exchangelist> findallexchangelist() {
		List<haipumi_exchangelist>exchangelist=null;
		exchangelist=exchangeMapper.findAllExchange();
		
		return exchangelist;
	}

	@Override
	public int countAllexchangelist() {
		int r=0;
		r=exchangeMapper.countAllExchange();
		return r;
	}

	@Override
	public haipumi_exchangelist updateexchangelist(
			haipumi_exchangelist exchangelist) {
		haipumi_exchangelist backexchangelist=null;
		int r=exchangeMapper.editExchange(exchangelist);
		if(r>0){
			return exchangelist;
		}
		return exchangeMapper.findExchangeByElid(Integer.parseInt(exchangelist.getElid()));
	}

}
